package conversion.service.impl;

import conversion.bean.Plugin;
import conversion.mapper.PluginMapper;
import conversion.service.PluginService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class PluginServiceImpl implements PluginService {

    @Resource
    private PluginMapper pluginMapper;


    @Override
    public void insertPlugin(Plugin plugin) {
        pluginMapper.insertPlugin(plugin);
    }

    @Override
    public Plugin getPluginById(Integer id) {
        return pluginMapper.getPluginById(id);
    }

    @Override
    public List<Plugin> getPluginByValue(String searchValue) {
        return pluginMapper.getPluginByValue(searchValue);
    }

    @Override
    public void updatePluginLoadStatus(Integer id, Boolean isLoad) {
        pluginMapper.updatePluginLoadStatus(id, isLoad);
    }

    @Override
    public void deletePlugin(Integer id) {
        pluginMapper.deletePlugin(id);
    }

    @Override
    public List<Plugin> getAllPluginByisLoad(boolean isLoad) {
        return pluginMapper.getPluginsByLoadStatus(isLoad);
    }

    @Override
    public List<Plugin> getAllPlugins() {
        return pluginMapper.getAllPlugins();
    }
}
